/*
 * File      : oled256x64.h
 *
 *
 * Change Logs:
 * Date           Author       Notes
 * 2014-5-19     zsf      	   The first version for LPC17xx
 */

#ifndef __OLED256X64_H__
#define __OLED256X64_H__

#include <rthw.h>
#include <rtthread.h>

#define	ASCII_XSIZE		8
#define	ASCII_YSIZE		16

#define	SCREEN_XSIZE	256
#define	SCREEN_YSIZE	64

#ifndef	ON
#define ON				1
#define OFF				0
#endif


#define OLED_DC_PIN				GPIO_Pin_8
#define OLED_DC_GPIO_PORT		GPIOD
#define OLED_DC_GPIO_CLK		RCC_APB2Periph_GPIOD

#define OLED_RST_PIN			GPIO_Pin_9
#define OLED_RST_GPIO_PORT		GPIOD
#define OLED_RST_GPIO_CLK		RCC_APB2Periph_GPIOD

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

struct coordinate_t
{
	rt_uint16_t x;
	rt_uint16_t y;
};

rt_inline void oled_reset(void);


extern void oled_initial(void);
void oled_clear(void);
void oled_fill(rt_uint8_t dat1, rt_uint8_t dat2);
void oled_Grayscale(void);
void oled_snow(void);
void showframe(void);
void oled_hor(void);
void oled_ver(void);

void Set_Column_Address(rt_uint8_t a, rt_uint8_t b);
void Set_Row_Address(rt_uint8_t a, rt_uint8_t b);
rt_err_t oled_write_cmd(rt_uint8_t cmd);
rt_err_t oled_write_data(rt_uint8_t data);
void oledDisplayASCII(struct coordinate_t Coordinate, rt_int16_t Character, rt_int8_t reverse);



#endif



